<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三角的做法</title>
    <style>
        .box1 {

            width: 0;
            height: 0;
            border-top: 10px solid red;
            border-left: 10px solid yellow;
            border-right: 10px solid blue;
            border-bottom: 10px solid green;
        }

        .box2 {

            width: 0;
            height: 0;
            border: 20px solid transparent;
            border-right: 20px solid violet;
            border-left: 20PX solid violet;
            margin: 0 auto;
        }

        .jing {
            width: 60px;
            height: 120px;
            background-color: royalblue;
            position: relative;
        }

        .jing span {
            width: 0;
            height: 0;
            border: 5px solid transparent;
            border-bottom-color: royalblue;
            position: absolute;
            right: 5px;
            top: -10px;
        }

        .mi {
            width: 120px;
            height: 60px;
            background-color: seagreen;
            position: relative;
        }

        .mi span {

            width: 0;
            height: 0;
            border: 5px solid transparent;
            border-left-color: seagreen;
            position: absolute;
            right: -10px;
            bottom: 20px;
        }
    </style>

</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="jing">
        <span></span>
    </div>

    <div class="mi">
        <span></span>
    </div>
</body>

</html>